package com.hotdog.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 前后端数据传输规范
 *
 * @author dell
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysResult {
    /**
     * 状态码
     */
    private Integer status;
    /**
     * 提示信息
     */
    private String msg;
    /**
     * 返回的业务数据
     */
    private Object data;


    public static SysResult fail() {
        return new SysResult(201, "业务执行失败", null);
    }

    public static SysResult success() {
        return new SysResult(200, "业务执行成功", null);
    }

    public static SysResult success(Object data) {
        return new SysResult(200, "业务执行成功", data);
    }

    public static SysResult success(String mes, Object data) {
        return new SysResult(200, mes, data);
    }

    public static SysResult success(String mes, Object data[]) {
        return new SysResult(200, mes, data);
    }

    public static SysResult fail(Integer status) {
        return new SysResult(status, "账号状态信息异常", null);
    }


}

